package org.mybatis.generator.internal.util;

public final class InitializationUtils {
  private InitializationUtils() {
    throw new AssertionError();
  }

  static String getInitializationVal(String shotName,String defVal) {
    switch (shotName) {
      case "String":
        if(null != defVal){
          return "\"" + defVal + "\"";
        }
        return "\"\"";

      case "Long":
      case "long":
        if(null != defVal){
          return defVal + "L";
        }
        return "0L";

      case "Integer":
      case "int":
        if(null != defVal){
          return defVal;
        }
        return "0";

      case "double":
      case "Double":
        if(null != defVal){
          return defVal + "D";
        }
        return "0D";

      case "float":
      case "Float":
        if(null != defVal){
          return defVal + "F";
        }
        return "0F";

      case "byte":
      case "Byte":
        if(null != defVal){
          return defVal;
        }
        return "0";
        
      case "short":
      case "Short":
        if(null != defVal){
          return defVal;
        }
        return "0";
        
      case "Boolean":
      case "boolean":
        if(null != defVal){
          if("false".equals(defVal) || "0".equals(defVal)){
            return "false";
          }
          return "true";
        }
        return "false";

      case "Date":
//        if(null != defVal){
//          if("CURRENT_TIMESTAMP".equalsIgnoreCase(defVal)){
//            return "new Date()";
//          }
//          return defVal;
//        }
        return "new Date()";
      case "BigDecimal":
        return "BigDecimal.ZERO";
      default:
        return "\"\"";
    }
  }
}
